﻿using EFDemo.Model;
using EFDemo.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            TestContext context = new TestContext();

            IRepository<Person> personObj = new EfRepository<Person>(context);

            for (int i = 0; i < 10; i++)
            {
                string id = Guid.NewGuid().ToString().Replace("-", "");
                personObj.Insert(new Person
                {
                    ID = id,
                    Name = "小强" + i,
                });

                Person p = personObj.GetById(id);
                Console.WriteLine("{0} {1} {2}", p.Name, p.CreateTime, p.ID);
            }
        }
    }
}
